/**
 * setInteval을 사용한 시계
 * date:2014.11
 * author:pwg
 */
var interval;
var cnt=0;
var week=['일','월','화','수','목','금','토'];

function intervalInit(){
	document.getElementById('btnStart').onclick=startFunc;
	document.getElementById('btnStop').onclick=stopFunc;
}
function startFunc(){
	interval = setInterval(clock, 1000);
}
function stopFunc(){
	clearInterval(interval);
}
function clock(){
	var now = new Date();
	cnt = now.getFullYear() + "년 ";
	cnt += (now.getMonth()+1) + "월 ";
	cnt += now.getDate() + "일 (";
	cnt += week[now.getDay()] + "요일)";
	
	cnt += now.getHours() + ":";
	cnt += now.getMinutes() + ":";
	cnt += now.getSeconds();
	var r = document.getElementById('result');
	r.innerHTML = cnt;
}








